<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/12/10
 * Time: 11:34
 */
require('../vendor/autoload.php');
require('../define.php');
use EasyWeChat\Factory;
use Symfony\Component\Cache\Simple\RedisCache;



$config = [
    'app_id'   => 'wxa951d508f6c0e252',
    'secret'   => '5f8127aedf08766fe6c9dfd80364c6fc',
    'token'    => 'J91A56Z5I42eG51g45VAv53a4vZ44O9d',
    'aes_key'  => 'N68B2A2Mvm2A65rzA8855vXZ8n2KmV8gKQ82RKCaCK5'
];
$openPlatform = Factory::openPlatform($config);
// 创建 redis 实例
$redis = new Redis();
$redis->connect(REDIS_HOST, 6379);
// 创建缓存实例
$cache = new RedisCache($redis);
// 替换应用中的缓存
$openPlatform->rebind('cache', $cache);